import request from '@/utils/myrequest'

export function getList(kvs) {
  return request({
    url: 'config/dept/getlist',
    method: 'get',
    kvs
  })
}

export function getAllDepts() {
  return request({
    url: 'config/dept/getall',
    method: 'get'
  })
}

export function add(kvs) {
  return request({
    url: 'config/dept/add',
    method: 'post',
    kvs
  })
}

export function get(kvs) {
  return request({
    url: 'config/dept/get',
    method: 'get',
    kvs
  })
}

export function del(kvs) {
  return request({
    url: 'config/dept/delete',
    method: 'post',
    kvs
  })
}

export function edit(kvs) {
  return request({
    url: 'config/dept/update',
    method: 'post',
    kvs
  })
}

export function changestatus(kvs) {
  return request({
    url: 'config/dept/changestatus',
    method: 'post',
    kvs
  })
}

export function download(kvs) {
  return request({
    url: 'config/download/GetTemplate',
    method: 'get',
    kvs
  })
}

export function getTreeList(kvs) {
  return request({
    url: '/config/dept/GetDeptTree',
    method: 'get',
    kvs
  })
}

export function doDelete(kvs) {
  return request({
    url: '/config/dept/Delete',
    method: 'POST',
    kvs
  })
}

export default { add, edit, del, changestatus, getList, get, download }
